package com.kfm.servlet;

import com.kfm.model.Account;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@WebServlet("/el")
public class ELServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9};
//        req.setAttribute("arr", arr);

//        List<String> list = new ArrayList<>();
//        list.add("范冰冰");
//        list.add("迪丽热巴");
//        list.add("赵丽颖");
//        list.add("杨颖");
//        list.add("刘亦菲");
//
//        Map map = new HashMap();
//        map.put("Roit", "LOL");
//        map.put("163", "逆水寒");
//        map.put("TiMi", "王者荣耀");
//
//        req.setAttribute("list", list);
//        req.setAttribute("map", map);

        Account account = new Account();
        account.setId(9);
        account.setName("abc");

        req.setAttribute("obj", account);
        req.getRequestDispatcher("get.jsp").forward(req, resp);
    }
}
